package com.ghost.manager
{
	import com.ghost.utils.Debug;
	
	import flash.display.DisplayObject;
	import flash.display.InteractiveObject;
	import flash.events.KeyboardEvent;

	/**
	 * @author ghost
	 * 键盘管理
	 */	
	public class Keyboard_manager
	{
		private static var instance:Keyboard_manager;
		public static function getInstance():Keyboard_manager
		{
			if(!instance == null)instance = new Keyboard_manager();
			return instance;
		}
		public function Keyboard_manager()
		{
			
		}
		public function add_key_event(obj:DisplayObject):void
		{
			obj.addEventListener(KeyboardEvent,key_Handler);
		}
		private function key_Handler(e:KeyboardEvent):void
		{
			Debug.log("键盘值:"+String(e.keyCode));
			var key_num:uint = e.keyCode;
			//分发
			switch(key_num)
			{
				case 0:
				{
					
					break;
				}
			}
		}
	}
}